<?php

use think\facade\Route;
use app\admin\middleware\LoginMiddleware;
use app\admin\middleware\AuthMiddleware;
use app\admin\middleware\OperationLog;

Route::group('cms', function () {

    Route::group('article', function () {
        //文章列表
        Route::get('lists', 'cms.Article/lists');
        //添加文章
        Route::post('add', 'cms.Article/add');
        //编辑文章
        Route::post('edit', 'cms.Article/edit');
        //文章详情
        Route::get('detail', 'cms.Article/detail');
        //删除文章
        Route::delete('delete', 'cms.Article/delete');
        //更改文章状态
        Route::post('updateStatus', 'cms.Article/updateStatus');
        //导入
        Route::post('export', 'cms.Article/export');
        //导出
        Route::post('import', 'cms.Article/import');
    });

    Route::group('cate', function () {
        //文章栏目列表
        Route::get('lists', 'cms.ArticleCate/lists');
        //添加文章栏目
        Route::post('add', 'cms.ArticleCate/add');
        //编辑文章栏目
        Route::post('edit', 'cms.ArticleCate/edit');
        //文章栏目详情
        Route::get('detail', 'cms.ArticleCate/detail');
        //删除文章栏目
        Route::delete('delete', 'cms.ArticleCate/delete');
        //获取文章栏目
        Route::get('all', 'cms.ArticleCate/all');
    });

})->middleware([
    LoginMiddleware::class,
    AuthMiddleware::class,
    OperationLog::class
]);